<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <video id="video" controls style="width: 640px; height: 480px;" src="./video.mp4"></video>
  <script>
    let video = document.getElementById("video");
    if (navigator && navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
      navigator.mediaDevices.getUserMedia({ audio: true }).then((mediastream) => {
        video.play();
      }).catch((err) => {
        alert("getUserMedia error");
        console.log('getUserMedia Error:', err);
      });
    } else {
      alert("not support getUserMedia");
    }

  </script>
</body>

</html>